package com.csjbot.coshandler.handle_msg.task;

import com.csjbot.coshandler.core.Robot;
import com.csjbot.coshandler.global.NTFConstants;
import com.csjbot.coshandler.global.RSPConstants;

/**
 * Created by jingwc on 2017/11/21.
 */

public class RbOther extends RbBase {
    @Override
    protected void handleNTFMessage(String dataSource, String msgId) {
        switch (msgId){
            case NTFConstants.ROBOT_BODY_HEAD_TOUCH_NTF:
                Robot.getInstance().pushHeadTouch();
                break;
            case NTFConstants.ROBOT_CHARGE_STATE_NTF:
                Robot.getInstance().pushChargeState(getIntSingleField(dataSource,"charge_state"));
                break;
            default:
                break;
        }
    }

    @Override
    protected void handleRSPMessage(String dataSource, String msgId) {
        switch (msgId){
            case RSPConstants.GET_MICRO_VOLUME_RSP:
                Robot.getInstance().pushMicrolVolume(getIntSingleField(dataSource,"volume"));
                break;
            default:
                break;
        }
    }
}
